<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <!-- 使用不同智能机的宽度 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="renderer" content="webkit">
    <title>MissQ校花</title>
    <link rel="stylesheet" href="css/base.css"/>
    <link rel="stylesheet" href="css/drawmoney.css"/>
    <script src="js/jquery-1.12.3.min.js"></script>
    <script>
        ;(function(win, doc){
            function change(){
                doc.documentElement.style.fontSize=20*doc.documentElement.clientWidth/320+'px';
            }

            if(doc.documentElement.clientWidth>640){
                doc.documentElement.style.fontSize=20*640/320+'px';
            }else{
                change();
            }
            win.addEventListener('resize', change, false);
        })(window, document);


        function onBridgeReady(){
            WeixinJSBridge.call('hideOptionMenu');
        }

        if (typeof WeixinJSBridge == "undefined"){
            if( document.addEventListener ){
                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
            }else if (document.attachEvent){
                document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
            }
        }else{
            onBridgeReady();
        }

        function GetQueryString(name)
        {
            var search = document.location.search;
            var pattern = new RegExp("[?&]"+name+"\=([^&]+)", "g");
            var matcher = pattern.exec(search);
            var items = null;
            if(null != matcher){
                try{
                    items = decodeURIComponent(decodeURIComponent(matcher[1]));
                }catch(e){
                    try{
                        items = decodeURIComponent(matcher[1]);
                    }catch(e){
                        items = matcher[1];
                    }
                }
            }
//                    alert(items)
            return items;
        }

        function getRecode(pn,id){
            $.ajax({
                type: 'GET',
                url: 'http://app.missquq.com/h5/rebBack/list',
                dataType: 'json',
                data:{
                    userId:id,
                    pn:pn
                },
                jsonp: 'callback',    // cbName
                dataType: 'jsonp', // 使用jsonp
                success: function(array) {
                    console.log(array)
                    if(pn<=array.page){
                        $.each(array.data,function(i){
                            var oLi=$('<li></li>');
                            oLi.html('<span class="fl">提现</span><i class="fl">￥'+array.data[i].amount+'</i><b class="fr">'+array.data[i].createTime+'</b>');
                            $('.drawMoneyList').append(oLi);
                        });
                        if(pn<array.page){
                            $('.getMore').css('display','block');
                        }else{
                            $('.getMore').css('display','none');
                        }
                    }else {
                        return false;
                    }


                }
            });
        }

        $(function(){
            var id=GetQueryString('userId');
            var pn=1;
            getRecode(pn,id);
            $('.getMore').on('click',function(){
                pn+=1;
                getRecode(pn,id);
            });
        });
    </script>
</head>
<body>
<div class="w640">
    <h1 class="draw-h1">提现记录<a href="javascript:history.go(-1);" class="goback"></a></h1>
    <div class="draw-space"></div>
    <ul class="drawMoneyList">
        <!--<li><span class="fl">提现</span><i class="fl">￥20.00</i><em class="fr">19:25</em><b class="fr">2016.09.21</b></li>-->
    </ul>
    <p class="getMore">加载更多...</p>
</div>
</body>
</html>